#define _CRT_SECURE_NO_WARNINGS 1

int compare(int a, int b)
{
    if (a > b)
        return 1;
    else if (b > a)
        return -1;
    else
        return 0;
}

int temperatureTrend(int* temperatureA, int temperatureASize, int* temperatureB, int temperatureBSize) {
    int i = 0;
    int max = 0;
    int count = 0;
    for (i = 0; i < temperatureASize - 1; i++)
    {
        count = 0;
        while (i < temperatureASize - 1 && (compare(temperatureA[i], temperatureA[i + 1]) == compare(temperatureB[i], temperatureB[i + 1]))
            )
        {
            count++;
            i++;
        }
        if (count > max)
            max = count;
    }
    return max;
}